package com.yuanfeng.business.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yuanfeng.business.entity.ShopHelpEntity;
import com.yuanfeng.business.mapper.ShopHelpMapper;
import com.yuanfeng.business.service.ShopHelpService;
import com.yuanfeng.commoms.constant.CommonType;
import com.yuanfeng.commoms.util.ResponseResult;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * @ClassName ShopHelpServiceImpl
 * @Description
 * @Author hyq
 * @Date 2023/7/7 13:26
 * @Version 1.0
 **/
@Service
public class ShopHelpServiceImpl extends ServiceImpl<ShopHelpMapper, ShopHelpEntity>
        implements ShopHelpService {
    @Override
    public ResponseResult queryShopHelpList(Map<String, Object> map) {
        List<ShopHelpEntity> shopHelpList = this.baseMapper.selectList(new LambdaQueryWrapper<ShopHelpEntity>()
                                            .eq(ShopHelpEntity::getHelpType, CommonType.commonStatus.NO.getCode())
                                            .eq(map.containsKey("pageShow"),ShopHelpEntity::getPageShow,map.get("pageShow").toString())
                                            .eq(!map.containsKey("pageShow"),ShopHelpEntity::getPageShow,1));
        return ResponseResult.success(shopHelpList);
    }
}
